******************************************************************************************************************************************
*MANUSCRIPT: Authorized Generic Entry prior to Patent Expiry: Reassessing Incentives for Independent Generic Entry 
*AUTHOR:     Silvia Appelt, University of Munich, silvia.appelt@lrz.uni-muenchen.de

******************************************************************************************************************************************
				        *** Extraction NPI data tables from SQL database: NPI DB06 (2000-2002/2003-2006) ***
						            		* Date last edit:  11 January 2015 * 
******************************************************************************************************************************************   
version 13.0
set more off
cap log close
clear

/*
For data inquiries, including database software, username and password, please contact:
INSIGHT Health GmbH & Co. KG
Auf der Lind 10
65529 Waldems-Esch
Tel.: 06126/955-0
Fax: 06126/955-20
E-Mail: info@insight-health.de
http://www.insight-health.de/ 
*/

odbc list
odbc query "NPI90DI", user(XXX) password(XXX)

odbc load,  table(abg) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table abg (DB06)"
save abg_db06.dta, replace
clear

odbc load,  table(atc1) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc1 (DB06)"
save atc1_db06.dta, replace
clear

odbc load,  table(atc2) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc2 (DB06)"
save atc2_db06.dta, replace
clear

odbc load,  table(atc3) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc3 (DB06)"
save atc3_db06.dta, replace
clear

odbc load,  table(atc4) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc4 (DB06)"
save atc4_db06.dta, replace
clear

odbc load,  table(DI_CODES) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_CODES (DB06)"
save DI_CODES_db06.dta, replace
clear

odbc load,  table(DI_COLUMNS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_COLUMNS (DB06)"
save DI_COLUMNS_db06.dta, replace
clear


odbc load,  table(DI_COMB_BASE) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_COMB_BASE (DB06)"
save DI_COMB_BASE_db06.dta, replace
clear


odbc load,  table(DI_COMB_ELEMS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_COMB_ELEMS (DB06)"
save DI_COMB_ELEMS_db06.dta, replace
clear

odbc load,  table(DI_FACTS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_FACTS (DB06)"
save DI_FACTS_db06.dta, replace
clear

odbc load,  table(DI_FUNCTIONS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_FUNCTIONS (DB06)"
save DI_FUNCTIONS_db06.dta, replace
clear


odbc load,  table(DI_GROUPS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_GROUPS (DB06)"
save DI_GROUPS_db06.dta, replace
clear


odbc load,  table(DI_GRP_BASE) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_GRP_BASE (DB06)"
save DI_GRP_BASE_db06.dta, replace
clear


odbc load,  table(DI_GRP_ELEMS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_GRP_ELEMS (DB06)"
save DI_GRP_ELEMS_db06.dta, replace
clear

odbc load,  table(DI_JOINS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_JOINS (DB06)"
save DI_JOINS_db06.dta, replace
clear


odbc load,  table(DI_ONE) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_ONE (DB06)"
save DI_ONE_db06.dta, replace
clear


odbc load,  table(DI_QDEF_TOPICS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_QDEF_TOPICS (DB06)"
save DI_QDEF_TOPICS_db06.dta, replace
clear

odbc load,  table(DI_TOPICS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_TOPICS (DB06)"
save DI_TOPICS_db06.dta, replace
clear

odbc load,  table(einf) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table einf(DB06)"
save einf_db06.dta, replace
clear


odbc load,  table(fbetrag) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table fbetrag (DB06)"
save fbetrag_db06.dta, replace
clear

odbc load,  table(gen) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table gen(DB06)"
save gen_db06.dta, replace
clear

odbc load,  table(hafo) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table hafo (DB06)"
save hafo_db06.dta, replace
clear

odbc load,  table(hst) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table hst(DB06)"
save hst_db06.dta, replace
clear

odbc load,  table(hst_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table hst_hist (DB06)"
save hst_hist_db06.dta, replace
clear

odbc load,  table(jahr) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table jahr(DB06)"
save jahr_db06.dta, replace
clear

odbc load,  table(jahr_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table jahr_hist (DB06)"
save jahr_hist_db06.dta, replace
clear

odbc load,  table(konz) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table konz (DB06)"
save konz_db06.dta, replace
clear

odbc load,  table(mat) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table mat (DB06)"
save mat_db06.dta, replace
clear

odbc load,  table(monat) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table monat (DB06)"
save monat_db06.dta, replace
clear

odbc load,  table(nfc1) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nfc1 (DB06)"
save nfc1_db06.dta, replace
clear


odbc load,  table(nfc2) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nfc2 (DB06)"
save nfc2_db06.dta, replace
clear


odbc load,  table(nfc3) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nfc3 (DB06)"
save nfc3_db06.dta, replace
clear

odbc load,  table(nnn) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nnn (DB06)"
save nnn_db06.dta, replace
clear

odbc load,  table(npi) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table npi (DB06)"
save npi_db06.dta, replace
clear

odbc load,  table(pck) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table pck (DB06)"
save pck_db06.dta, replace
clear

odbc load,  table(prd) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table prd (DB06)"
save prd_db06.dta, replace
clear

odbc load,  table(prdo) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table prdo (DB06)"
save prdo_db06.dta, replace
clear

odbc load,  table(pzn) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table pzn (DB06)"
save pzn_db06.dta, replace
clear

odbc load,  table(quartal) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table quartal (DB06)"
save quartal_db06.dta, replace
clear

odbc load,  table(str) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table str (DB06)"
save str_db06.dta, replace
clear

odbc load,  table(sub) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table sub (DB06)"
save sub_db06.dta, replace
clear

odbc load,  table(val) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table val (DB06)"
save val_db06.dta, replace
clear

odbc load,  table(val_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table val_hist (DB06)"
save val_hist_db06.dta, replace
clear

odbc load,  table(val_hst_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table val_hst_hist (DB06)"
save val_hst_hist_db06.dta, replace
clear

odbc load,  table(ytd) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table ytd (DB06)"
save ytd_db06.dta, replace
clear

odbc load,  table(zklass) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table zklass (DB06)"
save zklass_db06.dta, replace
clear


*** end of do file




